#!/bin/sh

SRC_DIR="../audio_file"
DST_FILE="audio.img"
DST_DIR="/tftp/"
HTTP_DIR="/var/www/html/"
G_CHIP_TYPE="$1"
G_PROJECT_NAME="$2"

if [ ! -d "tools/$G_PROJECT_NAME/audio_file" ];then
    exit
fi

echo "--------exist audio file--------"
rm ../audio_file/* -rf
cp tools/$G_PROJECT_NAME/audio_file/* ../audio_file/ -rf
chmod 777 ../audio_file/ -R

echo ">>>>>> ###### rm $DST_FILE"
rm $DST_FILE

../com_mksquashfs.sh $G_CHIP_TYPE $SRC_DIR $DST_FILE

echo ">>>>>> ###### rm $DST_DIR$DST_FILE"
rm $DST_DIR$DST_FILE
echo ">>>>>> ###### rm $HTTP_DIR$DST_FILE"
rm $HTTP_DIR$DST_FILE

echo ">>>>>> ###### cp $DST_FILE $DST_DIR"
cp $DST_FILE $DST_DIR
echo ">>>>>> ###### cp $DST_FILE $HTTP_DIR"
cp $DST_FILE $HTTP_DIR

